import { watch } from 'vue'
import { useI18n } from 'vue-i18n'

export default function useLocale() {
    const { t, locale } = useI18n()

    watch(locale, (val) => {
        uni.setStorageSync('locale', val)
    })

    return { t, locale }
}
